package com.twu.option;

import java.util.List;

import com.twu.util.OptionsUtil;

public class ReserveOption implements Option
{
	private List<String> allBooks;
	private int optionNumber;

	public ReserveOption(List<String> allBooks)
	{
		this.allBooks = allBooks;
	}

	@Override
	public String execute()
	{
		return OptionsUtil.isInRange(optionNumber, allBooks.size()) ? "Thank You! Enjoy the book."
				: "Sorry we don't have that book yet.";
	}

	@Override
	public String getTips()
	{
		return "Input a book number to select the book to reserve";
	}

	@Override
	public Option selectOption(int optionNumber)
	{
		this.optionNumber = optionNumber;
		return this;
	}
}
